package org.jeecg.modules.oa.service.impl;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

import org.jeecg.modules.oa.entity.ApprovalNode;
import org.jeecg.modules.oa.entity.ApprovalProcess;
import org.jeecg.modules.oa.mapper.ApprovalNodeMapper;
import org.jeecg.modules.oa.service.IApprovalNodeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Description: 审批节点
 * @Author: jeecg-boot
 * @Date:   2019-12-04
 * @Version: V1.0
 */
@Service
public class ApprovalNodeServiceImpl extends ServiceImpl<ApprovalNodeMapper, ApprovalNode> implements IApprovalNodeService {
   @Autowired
   private ApprovalNodeMapper approvalNodeMapper;

   @Override
   public IPage<ApprovalNode> selectAll(Page<ApprovalNode> page, String mainId) {
      List<ApprovalNode> approvalNodes = approvalNodeMapper.selectAll(mainId);
      Integer nodeCount = approvalNodeMapper.selectNodeCount(mainId);
      page.setTotal(nodeCount);
      page.setSize(20);
      page.setRecords(approvalNodes);
      return page;
   }
}
